
/*
	菜单主节点处理事件
*/
function showAndSendUrl(obj, url, currentpath,id) {
	obj.ClassName = "on";
	var linames = document.getElementsByTagName("li");
	if(linames != null && linames.length > 0)
	{
		for(var index=0; index<linames.length; index++)
		{
			var liname = linames[index];
			var liid = liname.id;
			var menunode = document.getElementById(liid+"1");
			
			if(liid == id)
			{
				liname.style.background = "url(../images/nav_bgc_03.jpg) 0 0 no-repeat";
				if(menunode != null)
				{
					menunode.style.display = 'inline';
				}
				
			}else
			{
				liname.style.background = "url(../images/nav_bgc_01.jpg) 0 0 no-repeat";
				
				if(menunode != null)
				{
					menunode.style.display = 'none';
				}
			}
		}
	}
	setBodyMessage(url);
	setTopMessage(currentpath);
	var e = window.event;
	stopEvent(e);
}
/*
	设置顶部frame的当前路径信息
*/
function setTopMessage(currentpath) {
	var current = window.self.parent.document.getElementById("currentpath");
	if (current != null) {
		current.innerHTML = transStringToString(currentpath);
	}
}

function setTopMessage1(currentpath) {
	var current = document.getElementById("currentpath");
	if (current != null) {
		current.innerHTML = transStringToString(currentpath);
	}
}

/*
	设置body体frame的数据信息
*/
function setBodyMessage(url) {
	var frame = window.self.parent.document.getElementById("bodyframe");
	if (frame != null && typeof (frame) == "object") {
		frame.src = url;
	}
}

function setBodyMessage1(url) {
	var frame = document.getElementById("bodyframe");
	if (frame != null && typeof (frame) == "object") {
		frame.src = url;
	}
}
/*
	菜单子节点处理事件
*/
function sendUrl(url, currentpath,obj) {
	var e = window.event;
	setBodyMessage(url);
	setTopMessage(currentpath);
	stopEvent(e);
	if(obj != null){
		obj.style.display = "none";
		//obj.style.display = "block";
	}
}


function sendUrl1(url, currentpath)
{
	var e = window.event;
	setBodyMessage1(url);
	setTopMessage1(currentpath);
	stopEvent(e);
}

//阻止事件向父类传播
function stopEvent(e) {
	if(e != null ){
		if ( e.stopPropagation) {
			e.stopPropagation();
		} else {
			e.cancelBubble = true;
		}
	}
}
/*
将=转换成 > 
*/
function transStringToString(content) {
	var result = '';
	if (content != null && content != '') 
	{
		for (var index = 0; index < content.length; index++) 
		{
			if (content.charAt(index) == ':') {
				result += " >> ";
			} else {
				result += content.charAt(index);
			}
		}
	} else {
		return "";
	}
	
	return result;
}

